package com.wx.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wx.common.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Table(name = "sys_banner")
@Data
public class SysBanner extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 6819051009295571796L;
    /**
     * 图片url
     */
    @ApiModelProperty(value = "图片url")
    @Column(name = "img_url")
    @NotEmpty(message = "文图片url不能为空")
    private String imgUrl;

    /**
     * 链接url
     */
    @ApiModelProperty(value = "链接url")
    @Column(name = "link_url")
    private String linkUrl;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    @Column(name = "sort")
    @NotNull(message = "排序不能为空")
    private Integer sort;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态")
    @Column(name = "status")
    private Integer status;

    /**
     * 开始时间
     */
    @Column(name = "begin_date")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "开始时间")
    @NotNull(message = "开始时间不能为空")
    private Date beginDate;

    /**
     * 结束时间
     */
    @Column(name = "end_date")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "结束时间")
    @NotNull(message = "结束时间不能为空")
    private Date endDate;

}